{extend name="base" /}
{block name="title"}账号申请{/block}
{block name="head"}{/block}
{block name="body"}
<div class="page-hd">
  <h1 class="page-hd-title" style="margin-bottom:0">账号申请</h1>
  <p class="page-hd-desc">初次申请</p>
</div>
<div class="page-bd">
<form>
  <div class="weui_cells weui_cells_form" style="margin-top:0">
    <div class="weui_cell">
      <div class="weui_cell_hd"><label class="weui_label">真实姓名</label></div>
      <div class="weui_cell_bd weui_cell_primary">
        <input class="weui_input" type="text" required placeholder="请输入真实姓名" name="zsxm" />
      </div>
      <div class="weui_cell_ft"><i class="weui_icon_warn"></i></div>
    </div>
    <!--
    <div class="weui_cell">
      <div class="weui_cell_hd"><label class="weui_label">身份证号</label></div>
      <div class="weui_cell_bd weui_cell_primary">
        <input class="weui_input" type="text" required pattern="[0-9xX]{15,18}" placeholder="请输入身份证号" notMatchTips="身份证格式不正确" name="sfzh" />
      </div>
      <div class="weui_cell_ft"><i class="weui_icon_warn"></i></div>
    </div>
    -->
    <div class="weui_cell">
      <div class="weui_cell_hd"><label for="" class="weui_label">安全密码</label></div>
      <div class="weui_cell_bd weui_cell_primary">
        <input class="weui_input" type="password" required pattern="[0-9]{6,16}" placeholder="请输入安全密码" notMatchTips="安全密码不正确" name="aqmm" />
      </div>
      <div class="weui_cell_ft"><i class="weui_icon_warn"></i></div>
    </div>
    <div class="weui_cell">
      <div class="weui_cell_hd"><label class="weui_label">手机号码</label></div>
      <div class="weui_cell_bd weui_cell_primary">
        <input class="weui_input" type="tel" required pattern="[0-9]{11}" maxlength="11" placeholder="请输入手机号码" emptyTips="请输入手机号" notMatchTips="请输入正确的手机号" name="sjhm" />
      </div>
      <div class="weui_cell_ft"><i class="weui_icon_warn"></i></div>
    </div>
    <!--
    <div class="weui_cell weui_vcode">
      <div class="weui_cell_hd"><label class="weui_label">验证码</label></div>
      <div class="weui_cell_bd weui_cell_primary">
        <input class="weui_input" type="number" required placeholder="点击验证码更换" tips="请输入验证码" />
      </div>
      <div class="weui_cell_ft">
        <i class="weui_icon_warn"></i>
        <a class="weui-vcode-btn">获取验证码</a>
      </div>
    </div>
    -->
  </div>
  <div class="weui_btn_area">
    <a class="weui_btn weui_btn_primary">提交</a>
  </div>
</form>
</div>
{/block}
{block name="foot"}
<script>
$(function () {
  var $form = $("form").form();
  $('.weui_btn_primary').on('click', function () {
    $form.validate(function (err) {
      console.log(err);
      if (!err) {
        var data = $form.serialize();
        console.log(data);
        $.req({
          type: 'POST',
          url: "{:url('register')}",
          data: data,
          success(resp, text, xhr) {
            $.alert(resp.error, function () {
              if (resp.errno == 0) {
                location.reload();
              }
            });
          }
        });
      }
    });
  });
});
</script>
{/block}